package com.syf.controller.RJController;

import com.syf.config.annotation.CommonResult;
import com.syf.config.exception.BizException;
import com.syf.config.exception.ControllerExceptionEnum;
import com.syf.domain.store.BsSmallClass;
import com.syf.service.BsSmallClassService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @author syf
 * @create 2022-02-08 9:23
 */
@RestController
@CommonResult  //全局响应处理，返回的格式改变，可能一想到前端的数据获取了
@RequestMapping("/smallclass")
@Api(tags = "软件分类--小类")
public class BsSmallClassController {

    @Autowired
    private BsSmallClassService bsSmallClassService;

    @PostMapping("/before/selSoftClassify")
    @ApiOperation(value = "查询软件分类")
    public List<BsSmallClass> selSoftClassify(){
        List<BsSmallClass> list = bsSmallClassService.list();
        return list;
    }


    @PostMapping("/testInvoke")
    @ApiOperation(value = "测试操作")
    public List<BsSmallClass> testInvoke(){
        if(1 == 1){
            throw new BizException(ControllerExceptionEnum.URL_NOT_EXIST);
        }

        return new ArrayList<BsSmallClass>();
    }

}
